/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package th.manager;

import com.google.inject.Inject;
import com.wideplay.warp.persist.Transactional;
import java.util.List;
import th.dao.InfoPetugasDAO;
import th.model.InfoPetugas;

/**
 *
 * @author fikri
 */
public class InfoPetugasManager {
    
    @Inject
    private InfoPetugasDAO infoPetugasDAO;
    
    
    public List<InfoPetugas> getSenaraiPetugas() {
        return infoPetugasDAO.findAll();
    }
    
    public InfoPetugas getPetugasById (String id) {
        return infoPetugasDAO.findById(Integer.valueOf(id));
    }
    
    @Transactional
    public void deletePetugas(InfoPetugas info) {
        infoPetugasDAO.delete(info);
    }
    
    @Transactional
    public void savePetugas(InfoPetugas petugas) {
        infoPetugasDAO.saveOrUpdate(petugas);
    }
    
}
